<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<script>
    function loadImag(src, resolve, reject) {
        let imgae = new Image();
        imgae.src = src;
        imgae.onload = () => {
            resolve(imgae)
        }
        imgae.onerror = reject;
    }
    loadImag("image/-11eb90281385231d.jpg", (imgae) => {
        document.body.appendChild(imgae);
        console.log("图片加载完成");
    }, () => {
        console.log("图片加载失败");
    })
    console.log("梅西")
</script>
<script>
    function interval(callback, delay = 50) {
        let id = setInterval(() => callback(id), delay);
    }
    interval(timeId => {
        const div = document.querySelector('div');
        let left = parseInt(window.getComputedStyle(div).left);
        div.style.left = left + 10 + "px";
        if (left >= 200) {
            clearInterval(timeId);
            interval((timeId) => {
                let left = parseInt(window.getComputedStyle(div).width);
                div.style.left = width - 10 + "px";
            }, 100)
        }
    }, 50);
    for (let i = 0; i < 200000; i++) {
        console.log(i);
    }
</script>

<body>

</body>

</html>